home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / sock / remsockport.c < prev   
C/C++ Source or Header  |  2001-05-12  |  514b  |  38 lines

  1.  
  2. /* 
  3. **    TEKlib
  4. **    (C) 2001 TEK neoscientists
  5. **    all rights reserved.
  6. **
  7. **    TVOID TRemSockPort(TPORT *msgport)
  8. **
  9. **    remove a messageport from socket
  10. **
  11. */
  12.  
  13. #include "tek/msg.h"
  14. #include "tek/debug.h"
  15. #include "tek/kn/exec.h"
  16. #include "tek/kn/sock.h"
  17.  
  18. TVOID TRemSockPort(TPORT *msgport)
  19. {
  20.     if (msgport)
  21.     {
  22.         TAPTR proxy;
  23.  
  24.         kn_lock(&msgport->lock);
  25.  
  26.         proxy = msgport->proxy;
  27.         msgport->proxy = TNULL;
  28.  
  29.         kn_unlock(&msgport->lock);
  30.  
  31.         if (proxy)
  32.         {
  33.             TSignal(proxy, TTASK_SIG_ABORT);
  34.             TDestroy(proxy);
  35.         }
  36.     }
  37. }
  38.